#pragma once

inline float saturate(float f)
{
	return (std::max)( (std::min)(f, 1.0f), 0.0f );
}

float noiseLoop(float x, float y, float z, float minFreq, float maxFreq, float ampl);
float fractalSum(float x, float y, float z, float minFreq, float maxFreq);
float turbulence(float x, float y, float z, float minFreq, float maxFreq);

float smoothstep(float edge0, float edge1, float x);
XMVECTOR smoothInterp(XMVECTOR v1, XMVECTOR v2, float t);